#include "StdAfx.h"
#include <iostream>
#include "Logger.h"
#include "Utility.h"

Logger* Logger::m_pLogger = NULL;

Logger* Logger::GetInstance()
{
    if (NULL == m_pLogger)
    {
        m_pLogger = new Logger();
    }

    return m_pLogger;
}

Logger::Logger()
{
    m_ofsLog.open("nettetris.log", std::ios_base::app | std::ios_base::out);
}

Logger::~Logger()
{
    m_ofsLog.close();
}

void Logger::Log(const std::string &str)
{
    m_ofsLog << GetTimeString() << "\t" << str << std::endl;
}